$(function () {
});

/**
 * 保存收藏课程
 * @param courseId 课程ID
 * @param callback 操作成功回调
 */
function saveCourseFavorites(courseId,callback) {
    isLogin(function () {
        $.ajax({
            url: baseloaction +'/web/uc/course/saveCourseFavorites',
            type:'post',
            dataType:'json',
            data:{
                'courseId':courseId
            },
            success:function (result) {
                if(result.success==true){
                    if($.isFunction(callback)){
                        callback(result.entity);
                    }
                }else{
                    icModale(0,'',result.message);
                }
            },
            error:function (error) {
                icModale(0,'','系统错误，收藏课程失败');
            }
        });
    });
}

function  findUserCourseFavorites(courseId) {
    setTimeout(function () {
        $.ajax({
            url:baseloaction +'/web/course/findUserCourseFavorites',
            type:'post',
            dataType:'json',
            data:{
                'courseId':courseId
            },
            success:function (result) {
                var entity = result.entity;
                if(entity !=null){

                }else{

                }
            },
            error:function (error) {

            }
        });
    },2000);
}